//
//  HomeViewController.m
//  AffectionBee
//
//  Created by 李通 on 16/8/18.
//  Copyright © 2016年 chivalrous. All rights reserved.
//

#import "HomeViewController.h"
#import "ScannerViewController.h"
#import "SearchViewController.h"
#import "UIBarButtonItem+Extension.h"

@interface HomeViewController ()

@end

@implementation HomeViewController


- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self setupCodeScanner];
}

/*  首页左上角的扫码功能实现  */
- (void)setupCodeScanner {
    
    self.navigationItem.leftBarButtonItem = [[[UIBarButtonItem alloc]init]barButtonWithTitle:@"扫一扫" titleColor:[UIColor blackColor] image:[[UIImage imageNamed:@"icon_black_scancode"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] hightLightImage:nil target:self action:@selector(didClickScanner) itemLoaction:YES];
    
    self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc]init]barButtonWithTitle:@"搜 索" titleColor:[UIColor blackColor] image:[[UIImage imageNamed:@"icon_search"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] hightLightImage:nil target:self action:@selector(didClickSearch) itemLoaction:NO];
}
//跳转到扫码界面
- (void)didClickScanner {
    
    [self.navigationController pushViewController:[[ScannerViewController alloc] init] animated:YES];
}
//跳转到搜索界面
- (void)didClickSearch {
    
    [self.navigationController pushViewController:[[SearchViewController alloc] init] animated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
